package cn.mall.base.exception;

import cn.mall.base.constants.ResultCodeEnum;
import cn.mall.base.utils.AjaxResult;
import lombok.Data;

/**
 * @author ：xc
 * @description：TODO
 * @date ：2023/12/7 15:25
 */


@Data
public class UserBaseException extends RuntimeException {


    private Boolean success = true;  //由于成功的概率较大，所以默认值给个true
    private String message = "操作成功";
    private Object resultObj;


    public UserBaseException(AjaxResult ajaxResult) {
        this.success = ajaxResult.getSuccess();
        this.message = ajaxResult.getMessage();
        this.resultObj = ajaxResult.getResultObj();
    }

    public UserBaseException(boolean success, String message, Object resultObj) {
        this.success = success;
        this.message = message;
        this.resultObj = resultObj;
    }

}
